package com.wangzaiplus.test.proxy;

import java.lang.reflect.InvocationHandler;
import java.lang.reflect.InvocationTargetException;
import java.lang.reflect.Method;

/**
 * @ClassName OwnerInvocationHandler
 * @Description: TODO
 * @Author wgc
 * @Date 2020/04/16 18:22
 * @Version V1.0
 **/
public class OwnerInvocationHandler implements InvocationHandler {
    PersonBean person;
    public OwnerInvocationHandler(PersonBean person) {
        this.person = person;
    }
    @Override
    public Object invoke(Object proxy, Method method, Object[] args) throws Throwable {
        try{
          return method.invoke(person,args);
        }catch(InvocationTargetException e) {
            e.printStackTrace();
        }
        return null;
    }
}
